package com.wjw;

import com.wjw.enums.AnimeTypeEnum;

/**
 * Factory - 静态动漫工厂
 *
 * @author ikaros
 * @date 2025-02-05 23:24:38
 * @see <a href="ikaros@qq.com">mailTo: ikaros@qq.com</a>
 */
public class SimpleAnimeFactory {

    public static BaseAnime createAnime(AnimeTypeEnum type) {
        if (type == null) {
            throw new RuntimeException("类型错误, 制作动漫失败~");
        }

        BaseAnime anime;
        switch (type) {
            case ALIEN:
                anime = new AlienAnime();
                break;
            case DAILY:
                anime = new DailyAnime();
                break;
            default:
                throw new RuntimeException("经费不足, 暂时无法制作~");
        }
        return anime;
    }
}
